package com.liuyuxing.test.service.impl;

import com.liuyuxing.test.entity.Fruit;
import com.liuyuxing.test.service.PromotionStrategyService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 无促销策略
 */
@Service
public class NoPromotionStrategyServiceImpl implements PromotionStrategyService {
    @Override
    public double applyPromotion(List<Fruit> fruits) {
        double total = 0;
        for (Fruit fruit : fruits) {
            total += fruit.getPricePerPound() * fruit.getPounds();
        }
        return total;
    }
}
